package com.icesoft.wechat.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.icesoft.framework.core.annotation.Entity;
import com.icesoft.framework.core.data.access.DataAccessCheckpoint;
import com.icesoft.system.annotation.AssociationCount;
import com.icesoft.system.entity.BaseLoginUser;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

@Getter
@Setter
@Accessors(chain = true)
@TableName("wechat_user")
@Entity(module = "system", describe = "微信用户")
@AssociationCount("微信用户")
public class WechatUser extends BaseLoginUser {

	@TableField
	@Column(value = "user_type", comment = "用户类型", type = MySqlTypeConstant.VARCHAR)
	private String userType;

	@TableField
	@Column(value = "display_name", comment = "显示名称", type = MySqlTypeConstant.VARCHAR)
	private String displayName;

	@TableField
	@Column(value = "phone", comment = "手机号", type = MySqlTypeConstant.VARCHAR)
	private String phone;

	@TableField
	@Column(value = "open_id", comment = "openId")
	private String openId;

	@TableField
	@Column(value = "union_id", comment = "unionId")
	private String unionId;

	@DataAccessCheckpoint
	@TableField
	@Column(value = "company_id", comment = "公司")
	private Long companyId;

	@TableField
	@Column(value = "app_id", comment = "appId", type = MySqlTypeConstant.VARCHAR)
	private String appId;

}
